import { Story, Canvas } from '@storybook/addon-docs';

# Pre Selected Rows

To pre-select rows based on your data:

```js
...
const rowPreExpanded = row => row.defaultExpanded

function MyComponent() {
  return (
    <DataTable
      columns={columns}
      data={data}
			expandableRows
			expandableRowExpanded={rowPreExpanded}
    />
  );
}
```

<Canvas>
	<Story id="expandable-pre-expanded--pre-expanded" />
</Canvas>
